<script language="javascript">

function disableassistance(theForm) {

		//set values to 'no entries' before object is disabled. This prevents a stack of errors on the next page

    	document.form.pres_is_1.value = "No entries";
    	document.form.pres_is_2.value = "No entries";
    	document.form.pres_is_3.value = "No entries";
    	document.form.pres_is_4.value = "No entries";

    	document.form.opt_1.value = "No entries";
    	document.form.opt_2.value = "No entries";
    	document.form.opt_3.value = "No entries";
    	document.form.opt_4.value = "No entries";

    	document.form.casew_name.value = "No entries";
    	document.form.casew_org.value = "No entries";

    	document.form.txtTimeTaken.value = "No entries";
    	document.form.txtInterviewer.value = "No entries";

		//disable form elements

	 	document.form.pres_is_1.disabled = true;
   	  	document.form.pres_is_2.disabled = true;
   	  	document.form.pres_is_3.disabled = true;
   	  	document.form.pres_is_4.disabled = true;

   	  	document.form.opt_1.disabled = true;
   	  	document.form.opt_2.disabled = true;
   	  	document.form.opt_3.disabled = true;
   	  	document.form.opt_4.disabled = true;

    	document.form.optCCD[0].disabled = true;
    	document.form.optCCD[1].disabled = true;
    	document.form.casew_name.disabled = true;
    	document.form.casew_org.disabled = true;

    	document.form.optClientSignature[0].disabled = true;
    	document.form.optClientSignature[1].disabled = true;
    	document.form.txtTimeTaken.disabled = true;
    	document.form.txtInterviewer.disabled = true;



}

function enableassistance(theForm) {
		//set values to 'no entries' before object is disabled. This prevents a stack of errors on the next page

    	document.form.pres_is_1.value = "";
    	document.form.pres_is_2.value = "";
    	document.form.pres_is_3.value = "";
    	document.form.pres_is_4.value = "";

    	document.form.opt_1.value = "";
    	document.form.opt_2.value = "";
    	document.form.opt_3.value = "";
    	document.form.opt_4.value = "";

    	document.form.casew_name.value = "";
    	document.form.casew_org.value = "";

    	document.form.txtTimeTaken.value = "";
    	document.form.txtInterviewer.value = "";

   	  	document.form.pres_is_1.disabled = false;
   	  	document.form.pres_is_2.disabled = false;
   	  	document.form.pres_is_3.disabled = false;
   	  	document.form.pres_is_4.disabled = false;

   	  	document.form.opt_1.disabled = false;
   	  	document.form.opt_2.disabled = false;
   	  	document.form.opt_3.disabled = false;
   	  	document.form.opt_4.disabled = false;

    	document.form.optCCD[0].disabled = false;
    	document.form.optCCD[1].disabled = false;
    	document.form.casew_name.disabled = false;
    	document.form.casew_org.disabled = false;

    	document.form.optClientSignature[0].disabled = false;
    	document.form.optClientSignature[1].disabled = false;
    	document.form.txtTimeTaken.disabled = false;
    	document.form.txtInterviewer.disabled = false;

}

function OpenWindow(url, name, width, height)
{
	popupWin = window.open(url, '', 'width=' + width + ', height=' + height + ',scrollbars,resizable')
}

</script>


<body onload="alert('This form MUST be completed. If you DO NOT wish to add data please check the button at the top of the page.')">

<?
echo "<form name=form method=\"POST\" action=\"?page=submit_page_2\">";



echo "<input type=\"hidden\" name=\"client_id\" value=\"$client_id\">";
echo "<input type=\"hidden\" name=\"visit_id\" value=\"$visit_id\">";

?>

<h1> Add Comments </h1>
<h4 align="right"><a href="javascript:void(OpenWindow('pages/page2_blank.php','',820, 550));">Print blank Page 2</a></h4>
<hr>

<table width="100%">

<tr>
	<td><b>Would you like to add data to Page 2?</b></td>
	<td><font size="2"><input type="radio" value="Y" name="optpage2" checked  onclick="enableassistance('form')">Yes
		<input type="radio" value="N" name="optpage2"   onclick="disableassistance('form')"   on>No</font></td>
</tr>


<tr>
	<td><b>Client Profile</b></td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td><b>Presenting Issues</b></td>
	<td><font size="2">(different issue each line)</font></td>
</tr>
<tr>
	<td>1.</td>
	<td><input type="text" name="pres_is_1" size="80"></td>
</tr>
<tr>
	<td>2.</td>
	<td><input type="text" name="pres_is_2" size="80"></td>
</tr>
<tr>
	<td>3.</td>
	<td><input type="text" name="pres_is_3" size="80"></td>
</tr>
<tr>
	<td>4.</td>
	<td><input type="text" name="pres_is_4" size="80"></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td><b>Options Discussed</b></td>
	<td><font size="2">(different option each line)</font></td>
</tr>
<tr>
	<td>1.</td>
	<td><input type="text" name="opt_1" size="80"></td>
</tr>
<tr>
	<td>2.</td>
	<td><input type="text" name="opt_2" size="80"></td>
</tr>
<tr>
	<td>3.</td>
	<td><input type="text" name="opt_3" size="80"></td>
</tr>
<tr>
	<td>4.</td>
	<td><input type="text" name="opt_4" size="80"></td>
</tr>
</table>
<p></p>
<hr>
<p></p>
<table width="100%">
<tr>
	<td>Do you have a Case-Worker/Cousellor/Doctor?</td>
	<td><input type="radio" value="Y" name="optCCD" checked>Yes
<input type="radio" value="N" name="optCCD">No</td>

</tr>
<tr>
	<td>If yes:</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td>Name of worker:</td>
	<td><input type="text" name="casew_name" size="30">
</tr>
<tr>
	<td>Name of Organisation:</td>
	<td><input type="text" name="casew_org" size="30">
</tr>
</table>

<p></p>
<hr>
<p></p>

<table>
<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td>Client Signature:
</td>
<td><input type="radio" value="Y" name="optClientSignature" checked>Yes
<input type="radio" value="N" name="optClientSignature">No</td>
</tr>

<tr>
<td>Time Taken: </td>
<td><input type="text" name="txtTimeTaken" size="20" maxlength="50"></td>
</tr>

<tr>
<td>Interviewer: </td>
<td><input type="text" name="txtInterviewer" size="20" maxlength="50"></td>
</tr>

</table>

<p></p>
<hr />
<p></p>

<table width="100%">

<tr>

<td align="center">
	<input type=submit value="Save" style="width:200px;" name="btnSaveForm">
</td>

</tr>
</form>
</TABLE>


</html>